package com.aaa.orderservice.controller;

import com.aaa.orderservice.po.Order;
import com.aaa.orderservice.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: YuXin
 * @Date : Created in 2020/11/3 16:34
 * @ClassName : OrderController
 * @Description :
 * @Package_Name : com.aaa.orderservice.controller
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    /**
     * 查询所有
     */
    @RequestMapping("selectAll")
    public List<Order> selectAll() {
        return orderService.selectAll();
    }

    /**
     * 添加
     */
    @RequestMapping("insertSelective")
    public int insertSelective(Order record) {
        return orderService.insertSelective(record);
    }

    /**
     * 根据主键删除
     */
    @RequestMapping("deleteByPrimaryKey")
    public int deleteByPrimaryKey(Integer id) {
        return orderService.deleteByPrimaryKey(id);
    }

    /**
     * 根据主键查询
     */
    @RequestMapping("selectByPrimaryKey")
    public Order selectByPrimaryKey(Integer id) {
        return orderService.selectByPrimaryKey(id);
    }

    /**
     * 修改
     */
    @RequestMapping("updateByPrimaryKeySelective")
    public int updateByPrimaryKeySelective(Order record) {
        return orderService.updateByPrimaryKeySelective(record);
    }

}
